<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查看停车场信息</title>
<jsp:include page="../../import.jsp" flush="true" />
<jsp:include page="assParkCommon.jsp" flush="true" /><!-- 时间格式转换 -->
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
			<form id="parkingLot">
			<div class="fieldset1 tabel_col clearFix">
				<div class="caption">
					<span class="title">停车场信息</span>
				</div>
				<div class="fieldBox col_33">
					<div class="label">停车场编号</div>
	                <div class="field">
	                    <span id="parkCd" name="parkCd">&nbsp;</span>
	                </div>
				</div>
	            <div class="fieldBox col_33">
					<div class="label">停车场名称</div>
					<div class="field">
						<span id="parkNm" name="parkNm">&nbsp;</span>
					</div>
				</div>
	            <div class="fieldBox col_33">
					<div class="label">停车场城市</div>
					<div class="field">
						<span id="provinceCity" name="provinceCity">&nbsp;${provinceCity}</span>
					</div>
				</div>
				<div class="fieldBox col_33">
					<div class="label">停车场联系人</div>
					<div class="field test_combo">
						<span id="contactNm" name="contactNm">&nbsp;</span>
					</div>
				</div>
	            <div class="fieldBox col_33">
	                <div class="label">停车场联系人电话</div>
	                <div class="field">
	                    <span id="contactTel" name="contactTel">&nbsp;</span>
	                </div>
	            </div>
	            <div class="fieldBox col_33">
					<div class="label">合同有效期</div>
					<div class="field">
						<span id="validDt" name="validDt">&nbsp;</span>
					</div>
				</div>
	            <div class="fieldBox col_100">
					<div class="label">停车场地址</div>
					<div class="field">
						<span id="parkAddress" name="parkAddress">&nbsp;</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">资产管理员</div>
					<div class="field" style="width: 100%;">
						<span id="assMgList" name="assMgList">
							<c:forEach items="${assMgsList}" var="assMgs">
	                            ${assMgs.managerRlNm}[${assMgs.managerNm}]&nbsp;&nbsp;
							</c:forEach>
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div style="width: 98%; margin-left: 1%;">
						<jsp:include page="../assCommFilesList.jsp" flush="true" ></jsp:include>
						<div id="ligergrid_file1" class="sq-grid"></div>
					</div>
				</div>
				<!-- 隐藏主键、系统代码(融资租赁系统)、用户状态(启用)、有效期ID -->
                <div class="fieldBox col_100" style="display:none;">
                    <div class="field">
                         <input name="pId" id="pId" type="text" class="ui-textbox" value="${id}">
                         <input name="searchSysCd" id="searchSysCd" type="text" class="ui-textbox" value="11000">
                         <input name="isValid" id="isValid" type="text" class="ui-textbox" value="1">
                         <input name="validId" id="validId" type="text" class="ui-textbox" value="${validId}">
                         <input name="validIdList" id="validIdList" type="text" class="ui-textbox" value="${validIdList}">
                    </div>
                </div>
			</div>
			</form>
	        
			<div class="fieldset1 tabel_col tabel_col_s clearFix">
				<div class="caption">
					<span class="title">历史信息</span>
				</div>
				<div class="fieldBox col_100">
	            	<div id="ligergrid_file2" class="sq-grid"></div>
				</div>
			</div>
		</div>
	</div>

    <script>
	    $(function() {
	        //初始化数据
	        initData();
	        initEvent();
	    	loadFilesLiger("tccfj", 1, $("#validId").val());//加载停车场文件列表信息
	    	loadFilesLiger("tcclsfj", 2, $("#validIdList").val());//加载停车场历史文件列表信息
	    });
	    
	    //初始化事件
	    function initEvent(){
		}
	    
	    function initData(){
	    	var _id = $("#pId").val();
	    	if(!_id)return;
	    	var wait_dialog= $.ligerDialog.SQalert({
	            content: LogUtils.LOG_CMM_LOADING,
	            SQ_type: "waitting",
	            onClose: function () {
	            }
	        });
	    	
	    	var _url = '<%=path%>/ass/assParking/getById.do';
	    	$.ajax({
	    		type: 'get',
	    		dataType:'json',
	    		data:{id:_id},
	    		url: _url,
	    		success:function(msg){
	    			 wait_dialog.close();
	    			 if(msg.success == 1){
	    				 setData(msg.data);//设置数据
	    			 }else{
	    				 $.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	    			 }
	    		}
	    	});
	    }
	
	    //设置页面数据
	    function setData(data){
	    	$("#parkCd").html(data.parkCd);
	    	$("#parkNm").html(data.parkNm);
	    	$("#parkAddress").html(data.parkAddress);
	    	$("#contactNm").html(data.contactNm);
	    	$("#contactTel").html(data.contactTel);
	    	//合同有效期
	    	var validDt=renderDate(data.beginDt)+"-"+renderDate(data.endDt);//格式化时间
	    	$("#validDt").html(validDt);
	    	//加载表单
	    	liger.get("parkingLot");
	    }
	
    </script>
</body>
</html>